package com.spring.cloud.practice.demo.consulconsumer.controller;

import com.spring.cloud.practice.demo.consulconsumer.feignClient.ConsulFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BookController {

    @Autowired
    ConsulFeignClient consulFeignClient;

    @GetMapping("/getBook")
    public String sayHi(@RequestParam( defaultValue = "forezp",required = false)String name){
        return consulFeignClient.getBookFromClientEureka(name);
    }

}
